import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

// 引入根组件 
import { UserComponent } from './user.component';

// 引入自己文件夹下的组件
import { ProfileComponent } from './components/profile/profile.component';
import { AddressComponent } from './components/address/address.component';

const routes: Routes = [
  {path:'',component:UserComponent},   // 这里是主路由(app-routing.module.ts) 跳转到这个  模块
  {path:'profile',component:ProfileComponent},  //  跳转到 本模块 下面的组件
  {path:'address',component:AddressComponent}   // 地址栏的地址是 /user/address
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class UserRoutingModule { }
